library(here)
library(galah)
library(skimr)
library(dplyr)
library(lubridate)
library(stringr)
library(ggplot2)
library(ggridges)
library(leaflet)
library(leaflet.extras)
library(reactable)
library(scico)
library(hrbrthemes)
library(patchwork)
reptilia <- readRDS(here("data", "reptilia"))
reptilia_tidy <- reptilia %>%
filter(cl22 == "Australian Capital Territory") %>%
rename(state = cl22,
forestType = cl10902) %>%
mutate(forestType = na_if(forestType, ""),
family = na_if(family, ""),
basisOfRecord = tolower(basisOfRecord),
basisOfRecord = str_replace(basisOfRecord, "_", " "),
eventDate = as_datetime(eventDate, tz = "Australia/Sydney", format = NULL),
eventDate = as_date(eventDate, tz = NULL),
month = month(eventDate))
Summary statistics for fields in the dataset of reptile occurrences in the ACT
skim(reptilia_tidy)
| Name | reptilia_tidy |
| Number of rows | 10145 |
| Number of columns | 12 |
| _______________________ | |
| Column type frequency: | |
| character | 8 |
| Date | 1 |
| numeric | 3 |
| ________________________ | |
| Group variables | None |
Variable type: character
| skim_variable | n_missing | complete_rate | min | max | empty | n_unique | whitespace |
|---|---|---|---|---|---|---|---|
| scientificName | 0 | 1 | 4 | 33 | 0 | 102 | 0 |
| genus | 0 | 1 | 0 | 16 | 106 | 52 | 0 |
| family | 38 | 1 | 8 | 15 | 0 | 11 | 0 |
| order | 0 | 1 | 0 | 10 | 4 | 3 | 0 |
| dataResourceName | 0 | 1 | 9 | 87 | 0 | 23 | 0 |
| basisOfRecord | 0 | 1 | 7 | 18 | 0 | 5 | 0 |
| state | 0 | 1 | 28 | 28 | 0 | 1 | 0 |
| forestType | 17 | 1 | 6 | 31 | 0 | 10 | 0 |
Variable type: Date
| skim_variable | n_missing | complete_rate | min | max | median | n_unique |
|---|---|---|---|---|---|---|
| eventDate | 5206 | 0.49 | 1954-01-22 | 2021-11-25 | 2012-10-08 | 1783 |
Variable type: numeric
| skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
|---|---|---|---|---|---|---|---|---|---|---|
| decimalLatitude | 0 | 1.00 | -35.34 | 0.15 | -35.91 | -35.40 | -35.3 | -35.24 | -35.12 | ▁▁▃▇▇ |
| decimalLongitude | 0 | 1.00 | 149.11 | 0.30 | 148.76 | 148.99 | 149.1 | 149.15 | 150.77 | ▇▂▁▁▁ |
| month | 5206 | 0.49 | 7.92 | 3.92 | 1.00 | 3.00 | 10.0 | 11.00 | 12.00 | ▃▁▁▂▇ |
Locations of reptiles in the ACT based on occurrence records of reptiles from the ALA. Interactive layers in the top right corner allow records to be differentiated based on the type of record (ALA id: basisOfRecord), forest type (ALA id: cl10902), and taxonomic family (ALA id: family) associated with each record.
Occurrence records for reptiles in the ACT. Columns may be sorted by clicking on column names, or filtered using the search bars under each column header. A global search bar in the top right corner enables searching the whole table.
# remove cols not of interest in a table
reptilia_subset <- reptilia_tidy %>%
select(eventDate:basisOfRecord, forestType)
reactable(
reptilia_subset,
columns = list(
eventDate = colDef(name = "Date"),
scientificName = colDef(name = "Species"),
genus = colDef(name = "Genus"),
family = colDef(name = "Family"),
order = colDef(name = "Order"),
dataResourceName = colDef(name = "Source"),
basisOfRecord = colDef(name = "Record type"),
forestType = colDef(name = "Forest type")
),
showSortable = TRUE,
filterable = TRUE,
searchable = TRUE,
striped = TRUE
)
Reptile occurrence counts between 1954 and 2021 in the ACT
reptilia_tidy %>%
filter(!is.na(eventDate)) %>%
group_by(eventDate) %>%
summarise(count = n()) %>%
ggplot() +
geom_line(aes(x = eventDate, y = count),
color = "#41507B") +
labs(x = "",
y = "Count") +
theme_ipsum()
Reptile occurrence counts by taxonomic family between 1954 and 2021 in the ACT
reptilia_tidy %>%
filter(!is.na(eventDate)) %>%
group_by(eventDate) %>%
summarise(count = n(), family = family) %>%
ggplot() +
geom_line(aes(x = eventDate, y = count),
color = "#41507B") +
facet_wrap(~family) +
labs(x = "Date",
y = "") +
theme_ipsum()
ALA occurrence download https://doi.org/10.26197/ala.53fe1002-7e7f-48f5-bce7-7f1f503db4e2. Accessed from R with galah 1.3.1 (https://github.com/AtlasOfLivingAustralia/galah/) on 2021-12-04.
sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19043)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252
## [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
## [5] LC_TIME=English_Australia.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] patchwork_1.1.1 hrbrthemes_0.8.0 scico_1.2.0
## [4] reactable_0.2.3 leaflet.extras_1.0.0 leaflet_2.0.4.1
## [7] ggridges_0.5.3 ggplot2_3.3.5 stringr_1.4.0
## [10] lubridate_1.7.10 dplyr_1.0.7 skimr_2.1.3
## [13] galah_1.3.1 here_1.0.1
##
## loaded via a namespace (and not attached):
## [1] httr_1.4.2 tidyr_1.1.4 sass_0.4.0
## [4] jsonlite_1.7.2 bslib_0.3.1 assertthat_0.2.1
## [7] highr_0.9 triebeard_0.3.0 sp_1.4-5
## [10] wellknown_0.7.4 urltools_1.7.3 yaml_2.2.1
## [13] gdtools_0.2.3 Rttf2pt1_1.3.8 pillar_1.6.3
## [16] lattice_0.20-44 glue_1.4.2 extrafontdb_1.0
## [19] digest_0.6.28 leaflet.providers_1.9.0 colorspace_2.0-2
## [22] htmltools_0.5.2 plyr_1.8.6 reactR_0.4.4
## [25] pkgconfig_2.0.3 httpcode_0.3.0 purrr_0.3.4
## [28] scales_1.1.1 tibble_3.1.5 proxy_0.4-26
## [31] farver_2.1.0 generics_0.1.0 ellipsis_0.3.2
## [34] withr_2.4.2 repr_1.1.3 magrittr_2.0.1
## [37] crayon_1.4.1 evaluate_0.14 data.tree_1.0.0
## [40] fansi_0.5.0 class_7.3-19 data.table_1.14.2
## [43] tools_4.1.1 lifecycle_1.0.1 munsell_0.5.0
## [46] compiler_4.1.1 jquerylib_0.1.4 e1071_1.7-9
## [49] systemfonts_1.0.2 rlang_0.4.11 classInt_0.4-3
## [52] units_0.7-2 grid_4.1.1 htmlwidgets_1.5.4
## [55] crosstalk_1.1.1 labeling_0.4.2 base64enc_0.1-3
## [58] rmarkdown_2.11 wk_0.5.0 gtable_0.3.0
## [61] DBI_1.1.1 curl_4.3.2 R6_2.5.1
## [64] knitr_1.36 fastmap_1.1.0 extrafont_0.17
## [67] utf8_1.2.2 rprojroot_2.0.2 KernSmooth_2.23-20
## [70] stringi_1.7.5 crul_1.1.0 Rcpp_1.0.7
## [73] vctrs_0.3.8 sf_1.0-4 tidyselect_1.1.1
## [76] xfun_0.26